home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesU-Z.lzh / Xenon2.lha / Xenon2 Install / Install next >
Text File  |  1999-05-29  |  5KB  |  208 lines

  1. ;****************************
  2.  
  3. (set #readme-file "README") ;name of readme file
  4. (set #last-disk 2)          ;amount of disks
  5. (set #disk-size 901120)     ;size of each disk
  6.  
  7. ;****************************
  8. ;----------------------------
  9. ; Checks if given program is reachable via the path
  10. ; if not abort install
  11. ; IN:  #program - to check
  12. ; OUT: -
  13.  
  14. (procedure P_chkrun
  15.   (if
  16.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  17.     ("")
  18.     (abort ("You must install \"%s\" first !\nIt must be accessible via the path.\nYou can find it in the whdload package." #program))
  19.   )
  20. )
  21.  
  22. ;----------------------------
  23. ; Create disk-Image using DIC
  24. ; IN:  #dest        - DestinationPath
  25. ;      #CI_diskname - DiskName
  26. ;      #CI_diskno   - DiskNumber
  27. ;      #CI_drive    - DriveToReadFrom
  28. ; OUT: -
  29.  
  30. (procedure P_image
  31.   (message ("\nInsert \"%s\" into drive %s !\n\n(make sure it's the right disk because it will not be checked)" #CI_diskname #CI_drive))
  32.   (if
  33.     (= 0 
  34.       (run ("cd \"%s\"\nDIC %s FD=%ld LD=%ld SIZE=%ld >CON:///1000//CLOSE" #dest #CI_drive #CI_diskno #CI_diskno #disk-size))
  35.     )
  36.     ("")
  37.     (abort "\"DIC\" has failed to create a diskimage")
  38.   )
  39. )
  40.  
  41. ;****************************
  42.  
  43. (if
  44.   (exists #readme-file)
  45.   (if
  46.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  47.     ("")
  48.     (run ("SYS:Utilities/More %s" #readme-file))
  49.   )
  50. )
  51.  
  52. (set #program "WHDLoad")
  53. (P_chkrun)
  54.  
  55. (set #program "DIC")
  56. (P_chkrun)
  57.  
  58. (set @default-dest
  59.   (askdir
  60.     (prompt ("Where should \"%s\" installed ?\nA drawer \"%s\" will automatically created." @app-name @app-name))
  61.     (help @askdir-help)
  62.     (default @default-dest)
  63.     (disk)
  64.   )
  65. )
  66. (set #dest (tackon @default-dest @app-name))
  67. (if
  68.   (exists #dest)
  69.   (
  70.     (set #choice
  71.       (askbool
  72.         (prompt ("\nDirectory \"%s\" already exists.\n Should it be deleted ?" #dest))
  73.         (default 1)
  74.         (choices "Delete" "Skip")
  75.         (help @askbool-help)
  76.       )
  77.     )
  78.     (if
  79.       (= #choice 1)
  80.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  81.     )
  82.   )
  83. )
  84. (makedir #dest
  85.   (help @makedir-help)
  86.   (infos)
  87. )
  88.  
  89. ;----------------------------
  90.  
  91. (if
  92.   (exists ("%s.newicon" @app-name))
  93.   (set #icon
  94.     (askchoice
  95.       (prompt "\nWhich icon do you like to install ?\n")
  96.       (default 0)
  97.       (choices "Normal" "NewIcon")
  98.       (help @askchoice-help)
  99.     )
  100.   )
  101.   (set #icon 0)
  102. )
  103. (select #icon
  104.   (set #icon ("%s.inf" @app-name))
  105.   (set #icon ("%s.newicon" @app-name))
  106. )
  107. (copyfiles
  108.   (help @copyfiles-help)
  109.   (source #icon)
  110.   (newname ("%s.info" @app-name))
  111.   (dest #dest)
  112. )
  113. (if
  114.   (exists #readme-file)
  115.   (copyfiles
  116.     (help @copyfiles-help)
  117.     (source #readme-file)
  118.     (dest #dest)
  119.   )
  120. )
  121. (if
  122.   (exists ("%s.info" #readme-file))
  123.   (copyfiles
  124.     (help @copyfiles-help)
  125.     (source ("%s.info" #readme-file))
  126.     (dest #dest)
  127.   )
  128. )
  129.  
  130. (set #version
  131.   (askchoice
  132.     (prompt "Which version of Xenon 2 do you like to install?")
  133.     (default 0)
  134.     (choices "Floppy Disk version" "CDTV version")
  135.     (help @askchoice-help)
  136.   )
  137. )
  138. (select #version
  139.   (
  140.     (copyfiles
  141.       (help @copyfiles-help)
  142.       (source ("%s.slave" @app-name))
  143.       (dest #dest)
  144.     )
  145.     ; in expert mode ask for source drive
  146.     (if
  147.       (= @user-level 2)
  148.       (
  149.         (set #CI_drive
  150.           (askchoice
  151.         (prompt "Select source drive for diskimages")
  152.         (default 0)
  153.         (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  154.         (help @askchoice-help)
  155.           )
  156.         )
  157.         (select #CI_drive
  158.           (set #CI_drive "DF0:")
  159.           (set #CI_drive "DF1:")
  160.           (set #CI_drive "RAD:")
  161.           (set #CI_drive
  162.             (askstring
  163.               (prompt "Select source drive for diskimages")
  164.               (default "DF0:")
  165.               (help @askstring-help)
  166.             )
  167.           )
  168.         )
  169.       )
  170.       (set #CI_drive "DF0:")
  171.     )
  172.     (set #CI_diskno 1)
  173.     (while
  174.       (<= #CI_diskno #last-disk)
  175.       (
  176.         (set #CI_diskname ("%s Disk %ld" @app-name #CI_diskno))
  177.         (P_image)
  178.         (run ("FileNote Disk.%ld %s Quiet" #CI_diskno @app-name))
  179.         (set #CI_diskno (+ #CI_diskno 1))
  180.       )
  181.     )
  182.   )
  183.   (
  184.     (copyfiles
  185.       (help @copyfiles-help)
  186.       (source ("%sCDTV.slave" @app-name))
  187.       (newname ("%s.Slave" @app-name))
  188.       (dest #dest)
  189.     )
  190.     (message "Insert your Xenon2 CD in any drive.")
  191.     (set #dest (tackon #dest "data"))
  192.     (makedir #dest
  193.       (help @makedir-help)
  194.     )
  195.     (copyfiles
  196.       (help @copyfiles-help)
  197.       (source "XENONII:")
  198.       (pattern "(intro|level?|piccode|picdata?|sounds??|speech??|x2)")
  199.       (dest #dest)
  200.     )
  201.   )
  202. )
  203.  
  204. ;----------------------------
  205.  
  206. (exit)
  207.  
  208.